<template>
  <svg :style="{ width: size, height: size }">
    <!-- 属性值必须是#icon-图标名称 -->
    <use :xlink:href="prefix + name" :fill="color"></use>
  </svg>
</template>

<script setup lang="ts">
import { defineProps } from 'vue'
defineProps({
  // xlink:href属性值的前缀
  prefix: {
    type: String,
    default: '#icon-'
  },
  name: {
    type: String
  },
  color: {
    type: String,
    default: ''
  },
  size: {
    type: String,
    default: '20px'
  },
})
</script>

<style scoped lang="scss">
</style>
